package com.at.bigdata.spark.core.rdd.io

import org.apache.spark.rdd.RDD
import org.apache.spark.sql.execution.streaming.state.StateStore.stop
import org.apache.spark.{SparkConf, SparkContext}

/**
 * 依赖关系
 * @author cdhuangchao3
 * @date 2023/3/6 8:40 PM
 */
object Spark01_RDD_IO_Save {

  def main(args: Array[String]): Unit = {
    val sparConf = new SparkConf().setMaster("local").setAppName("WordCount")
    val sc = new SparkContext(sparConf)

    val rdd = sc.makeRDD(List(
      ("a", 1),
      ("b", 2),
      ("c", 3),
    ))

    rdd.saveAsTextFile("output1")
    rdd.saveAsObjectFile("output2")
    rdd.saveAsSequenceFile("output3")

    sc.stop()
  }
}
